package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.DealDtl;
import com.xmtlxx.wms.domain.bo.DealDtlBo;
import com.xmtlxx.wms.domain.vo.DealDtlVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 处置明细Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface DealDtlMapper extends BaseMapperPlus<DealDtlMapper, DealDtl, DealDtlVo> {
    /**
     * 根据条件分页查询处置明细
     *
     * @param dealDtl 处置明细
     * @return Page DealDtl
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "d.create_by"),
//        @DataColumn(key = "deptName", value = "d.dept_id"),
//        @DataColumn(key = "userName", value = "d.create_by")
//    })
    Page<DealDtlVo> selectPageDealDtlList(@Param("page") Page<DealDtl> page,@Param("dealDtl") DealDtlBo dealDtl);

    @DataPermission({
        @DataColumn(key = "tenantName", value = "dl.create_by"),
        @DataColumn(key = "deptName", value = "dl.dept_id"),
        @DataColumn(key = "userName", value = "dl.create_by")
    })
    Page<DealDtlVo> pageDealDtlList(@Param("page") Page<DealDtl> page,@Param("dealDtl") DealDtlBo dealDtl);


    /**
     * 查询处置明细列表
     *
     * @param dealDtl 处置明细
     * @return 处置明细集合
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "d.create_by"),
//        @DataColumn(key = "deptName", value = "d.dept_id"),
//        @DataColumn(key = "userName", value = "d.create_by")
//    })
    List<DealDtlVo> selectDealDtlList(@Param("dealDtl") DealDtlBo dealDtl);

    DealDtlVo selectDealDtlVoByID(String id);

    List<DealDtl> selectDealDtl(@Param("dealDtl") DealDtlBo dealDtl);

    int updateDealDtl(@Param("dealDtl") DealDtlBo dealDtl);

    int updateDealDtlBatchById(@Param("list") List<DealDtl> dealDtls);

    Page<DealDtlVo> warnDealDtl(@Param("page") Page<DealDtl> page,@Param("dealDtl") DealDtlBo dealDtl);

    void deleteByTaskId(String id);

    @DataPermission({
        @DataColumn(key = "tenantName", value = "tt.create_by"),
        @DataColumn(key = "deptName", value = "tt.dept_id"),
        @DataColumn(key = "userName", value = "tt.create_by")
    })
    Page<DealDtlVo> getDealDtlList(@Param("page") Page<DealDtl> page,@Param("dealDtl") DealDtlBo dealDtl);
}
